package com.qf.utils;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;

/**
 * @author mark
 * @Title:
 * @Description:
 * @date 2020/9/24 002411:28
 */
public class ESClient {

    public static RestHighLevelClient getClient(){

        HttpHost httpHost = new HttpHost("192.168.1.171",9200);

        RestClientBuilder clientBuilder = RestClient.builder(httpHost);

        RestHighLevelClient client = new RestHighLevelClient(clientBuilder);

        return client;
    }
}
